
var http = require('../../../../service/http.js');//请求类
var util = require('../../../../utils/util.js');//工具类

const app = getApp();
Page({

  /**
   * 页面的初始数据
   */
  data: {
    orderUserList:[],//分销用户列表
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    wx.hideShareMenu();//隐藏转发菜单
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
    
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
    let that = this;
    let rd_session = wx.getStorageSync('rd_session');
    //获取订单用户列表
    http.getReq('/weixin/personal/getOrderUserList', {
      rdSession: rd_session
    }, function (res) {
      let orderUserList = res.data;
      if (orderUserList) {
        for (let i = 0; i < orderUserList.length; i++) {
          if (orderUserList[i].phone != null) {
            let phone = orderUserList[i].phone;
            orderUserList[i].phone = phone.substring(0, 3) + '****' + phone.substring(7, phone.length);
          }
        }
      }
      that.setData({
        orderUserList: orderUserList
      })

    });
    
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
    
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    
  },


  backToHome:function(){//返回首页
    app.backToHome(this);
  },
  onPullDownRefresh: function () {
    wx.stopPullDownRefresh()
  },

})